# -*- coding: utf-8 -*-
# @Time    : 2020/3/18 上午10:09
# @Author  : lilong


# Python中函数的特殊功能
# ==============================
def func(num):
    """定义内部函数并返回"""

    def firstInnerFunc():
        return "这是第一个内部函数"

    def secondInnerFunc():
        return "这是第二个内部函数"

    if num == 1:
        return firstInnerFunc
    else:
        return secondInnerFunc


print(func(1))
print(func(2))
print(func(1)())
print(func(2)())
print("######################")

firstFunc = func(1)
secondFunc = func(2)
print(firstFunc)
print(secondFunc)
print(firstFunc())
print(secondFunc())
